package com.olf.interpreter.execution;

import java.util.HashMap;
import java.util.Map;

import com.olf.openjvs.OException;
import com.olf.openjvs.toolkit.OLFToolkitAttach;

public abstract class AbstractStarter implements Executable {

	private Map<Integer, String> params = new HashMap<Integer,String>();
	static OLFToolkitAttach olfAttach = new OLFToolkitAttach();
	
	public AbstractStarter(){
		
	}
	
	public static boolean isOnline(){
		return olfAttach.isAttached();
	}
	
	public final void attach() throws OException{
		if (!olfAttach.isAttached()){
			olfAttach.attachApp();
		}
	}
	
	public final void dettach() throws OException{
		olfAttach.detachApp();
	}
	
	@Override
	public abstract String ExecuteLogic();


	public Map<Integer, String> getParams() {
		return params;
	}

}
